home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / INTERVIE / GRAPHIC / PFILE.H < prev    next >
C/C++ Source or Header  |  1991-12-10  |  2KB  |  75 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * PFile encapsulates standard file operations.
  25.  */
  26.  
  27. #ifndef pfile_h
  28. #define pfile_h
  29.  
  30. #include <stdio.h>
  31. #include <InterViews/defs.h>
  32.  
  33. class PFile {
  34. public:
  35.     PFile(char* filename);
  36.     ~PFile();
  37.     
  38.     char* GetName();
  39.     boolean Exists();
  40.     boolean Exists(char* filename);
  41.  
  42.     boolean Read(short& i);
  43.     boolean Read(int& i);
  44.     boolean Read(float& f);
  45.     boolean Read(char& c);
  46.     boolean Read(short* i, int count);
  47.     boolean Read(int* i, int count);
  48.     boolean Read(long* i, int count);
  49.     boolean Read(float* f, int count);
  50.     boolean Read(char* string);
  51.     boolean Read(char* string, int count);
  52.  
  53.     boolean Write(int i);
  54.     boolean Write(float f);
  55.     boolean Write(short* i, int count);
  56.     boolean Write(int* i, int count);
  57.     boolean Write(long* i, int count);
  58.     boolean Write(float* f, int count);
  59.     boolean Write(char* string);
  60.     boolean Write(char* string, int count);
  61.     
  62.     boolean SeekTo(long offset); /* offset bytes from beginning of file */
  63.     boolean SeekToBegin();
  64.     boolean SeekToEnd();
  65.  
  66.     long CurOffset();
  67.     boolean IsEmpty();
  68.     boolean Erase();
  69. protected:
  70.     char* name;
  71.     FILE* fd;
  72. };
  73.  
  74. #endif
  75.